package com.nbot.server.job;

import cn.hutool.log.StaticLog;
import com.nbot.server.util.SpringUtil;
import com.nbot.server.workers.OpcWorker;
import org.jinterop.dcom.common.JIException;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

import java.net.UnknownHostException;

/**
 * opc checkAllPoint报警监控任务
 */
@Component
public class OpcJob implements Job {


    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        StaticLog.info("3厂油井状态监控 * 4厂开关量报警");
        OpcWorker opcWorker = (OpcWorker) SpringUtil.getBean("opcWorker");
        try {
            opcWorker.checkAllPoint();//-4厂 -3厂
//            opcWorker.checkOilWell();//-3厂
        } catch (JIException e) {
            e.printStackTrace();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }

}